#include "rkvpss.h"


void  rkVpssInit()
{
    RK_S32 s32Ret = RK_SUCCESS;
    s32Ret = RK_MPI_SYS_Init();
    if (s32Ret != RK_SUCCESS) {
        return ;
    }
}

void rkVpssRun(int nMaxChn,const char* pDstFilePath,uint8_t *  pRGBImg[CHN_NORMAL_BUTT])
{
    int  i;
    TEST_VPSS_CTX_S ctx;

    memset(&ctx, 0, sizeof(TEST_VPSS_CTX_S));

    //  set default params.
    ctx.srcFileName[0]     = "/root/chn1_1080p.rgb";
    ctx.srcFileName[1]     = "/root/chn2_1080p.rgb";
    ctx.srcFileName[2]     = "/root/chn3_1080p.rgb";
    ctx.srcFileName[3]     = "/root/chn4_1080p.rgb";
    ctx.srcFileName[4]     = "/root/chn5_1080p.rgb";
    ctx.srcFileName[5]     = "/root/chn6_1080p.rgb";

    ctx.dstFilePath     = pDstFilePath;
    ctx.s32LoopCount    = 1;
    ctx.s32VProcDevType = VIDEO_PROC_DEV_GPU;
    ctx.s32GrpNum       = 6;

    ctx.s32ChnNum       = 2;

    ctx.bGrpCropEn      = RK_FALSE;

    ctx.s32GrpCropRatio = 1000;

    ctx.s32SrcCompressMode  = 0;
    ctx.s32SrcPixFormat     = RK_FMT_RGB888;

    ctx.s32GrpIndex         = 0;

    ctx.s32SrcGrpRate       = -1;
    ctx.s32DstGrpRate       = -1;

    ctx.s32SrcWidth         = 1920;
    ctx.s32SrcHeight        = 1080;



        ctx.stChanCfg[0].bChnCropEn          = RK_FALSE;
        ctx.stChanCfg[0].s32ChnCropRatio     = 1000;
        ctx.stChanCfg[0].s32DstWidth         = 640;
        ctx.stChanCfg[0].s32DstHeight        = 480;
        ctx.stChanCfg[0].u32ChnDepth         = 3;
        ctx.stChanCfg[0].s32SrcChnRate       = -1;
        ctx.stChanCfg[0].s32DstChnRate       = -1;
        ctx.stChanCfg[0].s32DstCompressMode  = 0;
        ctx.stChanCfg[0].s32DstPixFormat     = RK_FMT_YUV420SP;

        ctx.stChanCfg[1].bChnCropEn          = RK_FALSE;
        ctx.stChanCfg[1].s32ChnCropRatio     = 1000;
        ctx.stChanCfg[1].s32DstWidth         = 960;
        ctx.stChanCfg[1].s32DstHeight        = 540;
        ctx.stChanCfg[1].u32ChnDepth         = 3;
        ctx.stChanCfg[1].s32SrcChnRate       = -1;
        ctx.stChanCfg[1].s32DstChnRate       = -1;
        ctx.stChanCfg[1].s32DstCompressMode  = 0;
        ctx.stChanCfg[1].s32DstPixFormat     = RK_FMT_YUV420SP;

        TEST_VPSS_ModTest(&ctx);

}

void  rkVpssExit()
{
    RK_S32 s32Ret = RK_SUCCESS;
    s32Ret = RK_MPI_SYS_Exit();
    if (s32Ret != RK_SUCCESS) {
        return ;
    }
}
